package com.agu.mgt.spmgt.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.agu.utils.Query;

import java.util.List;
import java.util.Map;

import com.agu.mgt.spmgt.dao.EntSpUserDao;
import com.agu.entity.spmgt.EntSpUserEntity;
import com.agu.mgt.spmgt.service.EntSpUserService;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;


@Service("entSpUserService")
@Transactional(readOnly = true)
public class EntSpUserService{
	@Autowired
	private EntSpUserDao entSpUserDao;
	
	
	public EntSpUserEntity queryObject(Long id){
		return entSpUserDao.queryObject(id);
	}
	
	
	public List<EntSpUserEntity> queryList(Map<String, Object> map){
		return entSpUserDao.queryList(map);
	}

    
	public Page<EntSpUserEntity> queryPageList(Query query){
	    PageHelper.startPage(query.getPage(), query.getLimit());
	    return entSpUserDao.queryPageList(query);
	}
	
	
	public int queryTotal(Map<String, Object> map){
		return entSpUserDao.queryTotal(map);
	}
	
	
	@Transactional
	public void save(EntSpUserEntity entSpUser){
		entSpUserDao.save(entSpUser);
	}
	
	
	@Transactional
	public void update(EntSpUserEntity entSpUser){
		entSpUserDao.update(entSpUser);
	}
	
	
	@Transactional
	public void delete(Long id){
		entSpUserDao.delete(id);
	}
	
	
	@Transactional
	public void deleteBatch(Long[] ids){
		entSpUserDao.deleteBatch(ids);
	}
}
